#ifndef     MOBILE_H_
# define    MOBILE_H_

# include "GameObject.h"
# include "IMap.h"
# include "Graphics/MainGraphic.h"

class Mobile : public GameObject
{
public:
    virtual GameObject::objtype type() { return GameObject::MOBILE; }

public:
    static const float G = 9.81;
    static const float SLOWCOEFF = 30;
    static const float MOVESPEED = 350;
    static const float JUMPSPEED = -300;
    static unsigned char const HPMAX = 3;

public:
    Mobile() : GameObject(), _hp(HPMAX) {}
    Mobile(vector const & pos, vector const & vel, vector const & size, GameObject::direction const dir = GameObject::RIGHT)
        : GameObject(pos, vel, size, dir), _hp(HPMAX) {}
    Mobile(GameObject & oth) : GameObject(oth), _hp(HPMAX) {}

    virtual void update(float elapsedTime, IMap const & map);
    virtual void onHit();

    void move(GameObject::direction dir);
    void jump();

    void setPos(vector const & pos) { _pos = pos; }

private:
    unsigned char   _hp;
};

#endif   /* MOBILE_H_ */
